// word-reviewer.js
Component({
  properties: {
    currentWord: {
      type: Object,
      value: null
    },
    reviewStats: {
      type: Object,
      value: {
        total: 0,
        reviewed: 0
      }
    },
    showDifficultyRating: {
      type: Boolean,
      value: false
    },
    selectedDifficulty: {
      type: String,
      value: 'normal'
    }
  },

  methods: {
    // 播放单词发音
    playPronunciation: function() {
      this.triggerEvent('playpronunciation', { word: this.properties.currentWord });
    },
    
    // 显示复习操作按钮（选择难度后）
    showReviewActions: function(e) {
      const difficulty = e.currentTarget.dataset.difficulty;
      this.triggerEvent('selectdifficulty', { difficulty });
    },
    
    // 标记单词复习结果
    markReviewResult: function(e) {
      const { isRemembered } = e.currentTarget.dataset;
      this.triggerEvent('markresult', {
        wordId: this.properties.currentWord.id,
        isRemembered: isRemembered === 'true',
        difficulty: this.properties.selectedDifficulty
      });
    }
  }
});